package com.edcarlos.servico.dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class TipoServicoOpenHelp extends SQLiteOpenHelper {
	
	public static final String TBL_TIPOSERVICO = "tbtiposervico";
	public static final String DB_NAME = "migracao.db";
	public static final String TIPO_ID = "_id";
	public static final String TIPO_DESCRICAO = "descricao";
	public static final String TIPO_SETOR = "setor";
	public static final String TIPO_INTERNO = "internoexterno";
	public static final int VERSAO = 1;
	public static final String CREATE_TBL="CREATE TABLE " + TBL_TIPOSERVICO+"("+
	TIPO_ID+" integer primary key autoincrement, "+TIPO_DESCRICAO+" text not null, "+
	TIPO_SETOR+" integer not null, "+TIPO_INTERNO+" integer not null);";
	

	public TipoServicoOpenHelp(Context context) {
		super(context,DB_NAME, null, VERSAO);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(CREATE_TBL);
		
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE IF EXISTS "+ TBL_TIPOSERVICO);
		onCreate(db);
		
	}

}
